<template>
  <el-dialog
    class="item50-describe-dialog"
    :width="dialogWidth"
    :visible.sync="dialogVisible"
    :close-on-click-modal="true"
    v-dialogDrag="true"
    append-to-body
    @open="handleDialogOpen"
    @closed="handleDialogClosed"
  >
    <div slot="title" style="max-width: 90%;">
      <span class="el-dialog__title" style="display: inline-block;" v-if="type == 1">表V，光子束水中深度z处<i>$\overline E_z$</i>与模体表面<i>$\overline E_0$</i>平均能量之比，深度用<i>$R_p$</i>的分数给出。</span>
      <span class="el-dialog__title" style="display: inline-block;" v-if="type == 2">表IV，电子束在水模体表面的平均能量<i>$\overline E_0$</i>与宽束条件下SSD=1m时剂量和电离曲线的半值深度。</span>
      <span class="el-dialog__title" style="display: inline-block;" v-if="type == 3">表X，不同<i>$\overline E_0$</i>和不同水深时电子束的水与空气阻止本领比(<i>$S_{w,air}$</i>)。</span>
      <span class="el-dialog__title" style="display: inline-block;" v-if="type == 4">表XI，电子束的扰动修正因子。对于不用平均能量<i>$\overline E_z$</i>，在水模中参数深度，空腔长度为15mm，内半径为r的圆柱指形电离室的<i>$P_u$</i>值。</span>
      <span class="el-dialog__title" style="display: inline-block;" v-if="type == 5">表XIII，不同光子束能量参考深度处水与空气的阻止本领比(<i>$S_{w,air}$</i>)。</span>
    </div>

    <div v-if="type == 1">
      <div style="width: 100%; text-align: center; font-weight: bold; font-size: 18px;">
        平均入射能量
        <span style="border-top: 1px solid #666; height: 30px;">E</span>
        <sub>0</sub>
      </div>
      <table border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
        <thead>
          <tr>
            <th>z/R<sub>r</sub></th>
            <th>5MeV</th>
            <th>10MeV</th>
            <th>20MeV</th>
            <th>30MeV</th>
            <th>40MeV</th>
            <th>50MeV</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(trItem, trIndex) in type1Data" :key="trIndex">
            <td v-for="(tdItem, tdIndex) in trItem" :key="tdIndex">{{ tdItem }}</td>
          </tr>
        </tbody>
      </table>
    </div>

    <div v-if="type == 2">
      <table border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
        <thead>
          <tr>
            <th>
              <span style="border-top: 1px solid #666; height: 30px;">E</span>
              <sub>0</sub>
              (MeV)
            </th>
            <th>
              R<sup>D</sup>
              <span style="margin-left: -8px; font-size: 12px; position: relative; top: 5px;">50</span>
              (cm)
            </th>
            <th>
              R<sup>z</sup>(cm)
            </th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(trItem, trIndex) in type2Data" :key="trIndex">
            <td v-for="(tdItem, tdIndex) in trItem" :key="tdIndex">{{ tdItem }}</td>
          </tr>
        </tbody>
      </table>
    </div>

    <div v-if="type == 3">
      <div style="text-align: center; font-weight: bold; font-size: 18px; margin-bottom: 15px;">电子束能量(MeV)</div>
      <table border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
        <thead>
          <tr>
            <th></th>
            <th v-for="(item, index) in type3DataTr[0]" :key="index">{{ item }}</th>
          </tr>
          <tr>
            <th>R<sub>p</sub></th>
            <th v-for="(item, index) in type3DataTr[1]" :key="index">{{ item }}</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(trItem, trIndex) in type3Data" :key="trIndex">
            <td v-for="(tdItem, tdIndex) in trItem" :key="tdIndex">{{ tdItem }}</td>
          </tr>
        </tbody>
      </table>
    </div>

    <div v-if="type == 4">
      <table border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
        <thead>
          <tr>
            <th>
              <span style="border-top: 1px solid #666; height: 30px;">E</span>
              <sub>z</sub>
            </th>
            <th>r=1.5mm</th>
            <th>r=2.5mm</th>
            <th>r=3.5mm</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(trItem, trIndex) in type4Data" :key="trIndex">
            <td v-for="(tdItem, tdIndex) in trItem" :key="tdIndex">{{ tdItem }}</td>
          </tr>
        </tbody>
      </table>
    </div>

    <div v-if="type == 5">
      <table border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
        <thead>
          <tr>
            <th>
              射束质<br/>
              TPR<sup>20</sup>
              <span style="margin-left: -13px; font-size: 12px; position: relative; top: 5px;">10</span>
            </th>
            <th>
              D<sub>20</sub>/D<sup>α</sup>
              <span style="margin-left: -8px; font-size: 12px; position: relative; top: 5px;">10</span>
            </th>
            <th></th>
            <th>参考深度<br/>(cm)</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(trItem, trIndex) in type5Data" :key="trIndex">
            <td v-for="(tdItem, tdIndex) in trItem" :key="tdIndex">{{ tdItem }}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'Item50Describe',
  components: {},
  dicts: [],
  props: {
    show: {
      type: Boolean,
      default: false,
    },
    type: {
      type: Number,
      default: 0,
    }
  },
  data() {
    return {
      type1Data: [
        ['0.00', '1.000', '1.000', '1.000', '1.000', '1.000', '1.000'],
        ['0.05', '0.943', '0.941', '0.936', '0.929', '0.922', '0.915'],
        ['0.10', '0.888', '0.884', '0.875', '0.863', '0.849', '0.835'],
        ['0.15', '0.831', '0.826', '0.815', '0.797', '0.779', '0.761'],
        ['0.20', '0.772', '0.766', '0.754', '0.732', '0.712', '0.692'],
        ['0.25', '0.712', '0.705', '0.692', '0.669', '0.648', '0.627'],
        ['0.30', '0.651', '0.645', '0.633', '0.607', '0.584', '0.561'],
        ['0.35', '0.587', '0.583', '0.574', '0.547', '0.525', '0.503'],
        ['0.40', '0.527', '0.523', '0.514', '0.488', '0.466', '0.444'],
        ['0.45', '0.465', '0.462', '0.456', '0.432', '0.411', '0.390'],
        ['0.50', '0.411', '0.407', '0.399', '0.379', '0.362', '0.345'],
        ['0.55', '0.359', '0.355', '0.348', '0.329', '0.314', '0.299'],
        ['0.60', '0.313', '0.309', '0.300', '0.282', '0.269', '0.256'],
        ['0.65', '0.270', '0.265', '0.255', '0.239', '0.228', '0.217'],
        ['0.70', '0.231', '0.226', '0.216', '0.202', '0.192', '0.182'],
        ['0.75', '0.197', '0.191', '0.180', '0.168', '0.159', '0.150'],
        ['0.80', '0.164', '0.159', '0.149', '0.138', '0.131', '0.124'],
        ['0.85', '0.137', '0.131', '0.120', '0.111', '0.105', '0.099'],
        ['0.90', '0.114', '0.108', '0.096', '0.089', '0.084', '0.079'],
        ['0.95', '0.091', '0.086', '0.076', '0.069', '0.065', '0.061'],
        ['1.00', '0.077', '0.071', '0.059', '0.053', '0.049', '0.045']
      ],
      type2Data: [
        ['1', '0.3', '0.3'],
        ['2', '0.7', '0.7'],
        ['3', '1.2', '1.2'],
        ['4', '1.6', '1.6'],
        ['5', '2.1', '2.1'],
        ['6', '2.5', '2.5'],
        ['7', '3.0', '3.0'],
        ['8', '3.4', '3.4'],
        ['9', '3.8', '3.8'],
        ['10', '4.3', '4.3'],
        ['12', '5.1', '5.1'],
        ['14', '6.0', '5.9'],
        ['16', '6.8', '6.7'],
        ['18', '7.8', '7.6'],
        ['20', '8.6', '8.4'],
        ['22', '9.4', '9.2'],
        ['25', '10.7', '10.4'],
        ['30', '12.8', '12.3'],
        ['35', '14.6', '14.0'],
        ['40', '16.3', '15.4'],
        ['45', '18.1', '16.9'],
        ['50', '19.7', '18.2']
      ],
      type3DataTr: [
        ['50', '40', '30', '25', '20', '18', '16', '14', '12', '10.0', '9.0', '8.0', '7.0', '6.0', '5.0', '4.0', '3.0', '2.0', '1.0'],
        ['24.6', '19.6', '14.8', '12.3', '9.87', '8.88', '7.89', '6.9', '5.91', '5.02', '4.52', '4.02', '3.52', '3.02', '2.52', '2.02', '1.51', '1.01', '0.505']
      ],
      type3Data: [
        ["0.0", "0.904", "0.912", "0.926", "0.940", "0.955", "0.961", "0.969", "0.977", "0.986", "0.997", "1.003", "1.011", "1.019", "1.029", "1.040", "1.059", "1.078", "1.097", "1.116"],
        ["0.1", "0.905", "0.913", "0.929", "0.941", "0.955", "0.962", "0.969", "0.978", "0.987", "0.998", "1.005", "1.012", "1.020", "1.030", "1.042", "1.061", "1.081", "1.101", "1.124"],
        ["0.2", "0.906", "0.914", "0.930", "0.942", "0.956", "0.963", "0.970", "0.978", "0.988", "0.999", "1.006", "1.013", "1.022", "1.032", "1.044", "1.064", "1.084", "1.106", "1.131"],
        ["0.3", "0.907", "0.915", "0.931", "0.943", "0.957", "0.964", "0.971", "0.979", "0.989", "1.000", "1.007", "1.015", "1.024", "1.034", "1.046", "1.067", "1.089", "1.112", "1.135"],
        ["0.4", "0.908", "0.916", "0.932", "0.944", "0.958", "0.965", "0.972", "0.980", "0.990", "1.002", "1.009", "1.017", "1.026", "1.036", "1.050", "1.071", "1.093", "1.117", "1.136"],
        ["0.5", "0.909", "0.917", "0.933", "0.945", "0.959", "0.966", "0.973", "0.982", "0.991", "1.003", "1.010", "1.019", "1.028", "1.039", "1.054", "1.076", "1.098", "1.122", ""],
        ["0.6", "0.909", "0.918", "0.934", "0.946", "0.960", "0.967", "0.974", "0.983", "0.993", "1.005", "1.012", "1.021", "1.031", "1.043", "1.058", "1.080", "1.103", "1.126", ""],
        ["0.8", "0.911", "0.920", "0.936", "0.948", "0.962", "0.969", "0.976", "0.985", "0.996", "1.009", "1.016", "1.026", "1.037", "1.050", "1.067", "1.090", "1.113", "1.133", ""],
        ["1.0", "0.913", "0.922", "0.938", "0.950", "0.964", "0.971", "0.979", "0.988", "0.999", "1.013", "1.021", "1.031", "1.043", "1.058", "1.075", "1.099", "1.121", ""],
        ["1.2", "0.914", "0.924", "0.940", "0.952", "0.966", "0.973", "0.981", "0.991", "1.002", "1.017", "1.026", "1.037", "1.050", "1.066", "1.085", "1.108", "1.129", ""],
        ["1.4", "0.916", "0.925", "0.942", "0.954", "0.968", "0.976", "0.984", "0.994", "1.006", "1.022", "1.032", "1.044", "1.058", "1.075", "1.095", "1.117", "1.133", "", ""],
        ["1.6", "0.917", "0.927", "0.944", "0.956", "0.971", "0.978", "0.987", "0.997", "1.010", "1.027", "1.038", "1.050", "1.066", "1.084", "1.104", "1.124", "", ""],
        ["1.8", "0.918", "0.929", "0.945", "0.957", "0.973", "0.981", "0.990", "1.001", "1.014", "1.032", "1.044", "1.057", "1.074", "1.093", "1.112", "1.130", "", ""],
        ["2.0", "0.920", "0.930", "0.947", "0.959", "0.975", "0.983", "0.993", "1.004", "1.018", "1.038", "1.050", "1.065", "1.082", "1.101", "1.120", "1.133", "", "", ""],
        ["2.5", "0.923", "0.934", "0.952", "0.964", "0.981", "0.990", "1.000", "1.013", "1.030", "1.053", "1.067", "1.083", "1.102", "1.120", "1.131", "", "", ""],
        ["3.0", "0.926", "0.938", "0.956", "0.969", "0.987", "0.997", "1.008", "1.023", "1.042", "1.069", "1.084", "1.102", "1.119", "1.129", "", "", ""],
        ["3.5", "0.929", "0.941", "0.960", "0.974", "0.994", "1.004", "1.017", "1.034", "1.056", "1.085", "1.102", "1.118", "1.128", "", "", "", "", ""],
        ["4.0", "0.932", "0.944", "0.964", "0.979", "1.001", "1.012", "1.027", "1.046", "1.071", "1.101", "1.116", "1.126", "", "", "", "", "", ""],
        ["4.5", "0.935", "0.948", "0.969", "0.985", "1.008", "1.021", "1.037", "1.059", "1.086", "1.115", "1.125", "1.127", "", "", "", "", "", ""],
        ["5.0", "0.936", "0.951", "0.973", "0.990", "1.016", "1.030", "1.049", "1.072", "1.101", "1.123", "1.126", "", "", "", "", "", "", ""],
        ["5.5", "0.940", "0.954", "0.978", "0.996", "1.024", "1.040", "1.061", "1.086", "1.113", "1.125", "", "", "", "", "", "", "", ""],
        ["6.0", "0.943", "0.958", "0.983", "1.002", "1.033", "1.051", "1.074", "1.100", "1.121", "", "", "", "", "", "", "", "", ""],
        ["7.0", "0.948", "0.965", "0.993", "1.017", "1.054", "1.075", "1.099", "1.118", "1.122", "", "", "", "", "", "", "", "", ""],
        ["8.0", "0.954", "0.972", "1.005", "1.032", "1.076", "1.098", "1.116", "1.120", "", "", "", "", "", "", "", "", "", ""],
        ["9.0", "0.960", "0.981", "1.018", "1.049", "1.098", "1.114", "1.118", "", "", "", "", "", "", "", "", "", "", ""],
        ["10.0", "0.966", "0.990", "1.032", "1.068", "1.112", "1.116", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["12.0", "0.980", "1.009", "1.062", "1.103", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["14.0", "0.996", "1.031", "1.095", "1.107", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["16.0", "1.013", "1.056", "1.103", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["18.0", "1.031", "1.080", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["20.0", "1.051", "1.094", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["22.0", "1.070", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["24.0", "1.082", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
        ["26.0", "1.085", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
    ],
      type4Data: [
        ['4', '0.981', '0.967', '0.955'],
        ['6', '0.984', '0.974', '0.963'],
        ['8', '0.988', '0.980', '0.971'],
        ['10', '0.991', '0.984', '0.978'],
        ['12', '0.993', '0.988', '0.984'],
        ['15', '0.995', '0.992', '0.989'],
        ['20', '0.997', '0.995', '0.994']
      ],
      type5Data: [
        ['0.50', '0.44', '1.135', '5'],
        ['0.53', '0.47', '1.134', '5'],
        ['0.56', '0.49', '1.132', '5'],
        ['0.59', '0.52', '1.130', '5'],
        ['0.62', '0.54', '1.127', '5'],
        ['0.65', '0.56', '1.123', '5'],
        ['0.68', '0.58', '1.119', '5'],
        ['0.70', '0.60', '1.116', '5'],
        ['0.72', '0.61', '1.111', '10'],
        ['0.74', '0.63', '1.105', '10'],
        ['0.76', '0.65', '1.099', '10'],
        ['0.78', '0.66', '1.090', '10'],
        ['0.80', '0.68', '1.080', '10'],
        ['0.82', '0.69', '1.069', '10'],
        ['0.84', '0.71', '1.059', '10']
      ]
    }
  },
  computed: {
    dialogWidth() {
      if (this.type == 1) {
        return '600px'
      } else if (this.type == 2) {
        return '400px'
      } else if (this.type == 3) {
        return '1200px'
      } else if (this.type == 4) {
        return '500px'
      } else if (this.type == 5) {
        return '500px'
      }
    },
    dialogVisible: {
      get() {
        return this.show
      },
      set(value) {
        this.$emit('update:show', value)
      }
    }
  },
  created() {
  },
  methods: {
    // 弹框打开时
    handleDialogOpen() {
    },
    // 弹框关闭时
    handleDialogClosed() {
    },
  }
}
</script>

<style lang="scss" scoped>
.item50-describe-dialog {

  ::v-deep .el-dialog__body {
    max-height: 90vh;
    overflow-y: auto;
  }

  table thead tr th {
    padding-bottom: 5px;
    border-bottom: 1px solid #ccc;
  }

  table tbody tr td {
    padding: 3px 0;
    text-align: center;
  }
}
</style>